package com.qxsx.midi.activity.main;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.animation.AlphaAnimation;
import android.view.animation.AnimationSet;
import android.widget.ImageView;


import com.igexin.sdk.PushManager;
import com.qxsx.midi.R;

import java.util.Timer;
import java.util.TimerTask;

public class LogoActivity extends Activity {

    ImageView logoImage;
    SharedPreferences login;
    String login_id;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_logo);
        PushManager.getInstance().initialize(this.getApplicationContext());



        // 3秒后跳转到主界面
        Timer timer = new Timer();
        timer.schedule(new TimerTask() {
            @Override
            public void run() {
                Intent intent = new Intent(LogoActivity.this, MainActivity.class);
                startActivity(intent);
                LogoActivity.this.finish();
            }
        }, 3000);




        logoImage = (ImageView)findViewById(R.id.logo_image);
        AnimationSet animSet = new AnimationSet(true);
        AlphaAnimation alphaAnimation = new AlphaAnimation(0,1);
        alphaAnimation.setDuration(2500);
        animSet.addAnimation(alphaAnimation);
        logoImage.startAnimation(animSet);
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        return false;
    }
}

